#!/bin/bash
# License: GPLv3
# Author: Fritz Thomas <fritztho@gmail.com>
# Website: http://fritzthomas.com

GK_DEFAULT_OPTIONS="--clean --mrproper --splash=default --splash-res=800x600 --install";

if [[ ! -f /usr/src/config ]] ; then
	echo "There is no '/usr/src/config' file. Exiting.";
	exit 1;
fi

if [[ ! -z $1 && "$1" == "config" ]] ; then
    GK_OPTIONS="--menuconfig ";
fi

GK_OPTIONS="${GK_DEFAULT_OPTIONS} ${GK_OPTIONS}";

genkernel --kernel-config=/usr/src/config $GK_OPTIONS all
exit $?
